<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>视频增加</title>
    <link rel="stylesheet" th:href="@{/css/pintuer.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <script type="application/javascript" th:src="@{/js/jquery-3.5.1.js}"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head" id="add">
        <strong><span class="icon-pencil-square-o"></span>增加视频类别</strong>
    </div>
    <div class="body-content">
        <form id="myForm" method="post" enctype="multipart/form-data" class="form-x" action="/video/updateOrAdd">
            <div class="form-group">
                <div class="label">
                    <label>视频名称：</label>
                </div>
                <div class="field">
                    <input style="display: none" name="id" th:value="${video}==null?'':${video.id}">
                    <input  type="text" id="name" class="input w50" th:value="${video}==null?'':${video.title}"  name="name" />
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>选择视频：</label>
                </div>
                <div class="field">
                    <input type="file" name="videoFile" accept="video/*"/>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>选择封面：</label>
                </div>
                <div class="field">
                    <input type="file" name="videoCover" accept="image/*"/>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>视频类别：</label>
                </div>
                <div class="field">
                    <select  id="categoryId" name="categoryId" class="input"
                                style="width:200px; line-height:17px;">
                        <option th:selected="${video.categoryId}==${category.id}"   th:value="${category.id}" th:each="category:${categories}" th:text="${category.name}"></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <div class="label">-->
<!--                    <label>播放数量：</label>-->
<!--                </div>-->
<!--                <div class="field">-->
<!--                    <input  type="text"  class="input w50" th:value="${video}==null?'':${video.viewNum}"  name="viewNum" />-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <div class="label">-->
<!--                    <label>点赞数：</label>-->
<!--                </div>-->
<!--                <div class="field">-->
<!--                    <input  type="text"  class="input w50" th:value="${video}==null?'':${video.praiseNum}"  name="praiseNum" />-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <div class="label">
                    <label>状态：</label>
                </div>
                <div class="field">
                    禁用: <input th:checked="${video.status}" th:value="true" type="radio" name="status" >
                    未禁用:<input th:checked="!${video.status}" th:value="false" type="radio" name="status">
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="submit">
                        提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>